<?php if (!defined('THINK_PATH')) exit();?>
 <head>
   <!--<meta charset="UTF-8">
   -->
   <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
   <link rel="stylesheet" href="__PUBLIC__/css/common.css">
   <link rel="stylesheet" href="__PUBLIC__/css/main.css">
   <script type="text/javascript" src="__PUBLIC__/js/jquery.min.js"></script>
   <script type="text/javascript" src="__PUBLIC__/js/colResizable-1.3.min.js"></script>
   <script type="text/javascript" src="__PUBLIC__/js/common.js"></script>
   
   <script type="text/javascript">
      $(function(){  
        $(".list_table").colResizable({
          liveDrag:true,
          gripInnerHtml:"<div class='grip'></div>", 
          draggingClass:"dragging", 
          minWidth:30
        }); 
        
      }); 
   </script>
   <title>订单列表</title>
 </head>
 <body>
 <!--
 登陆成功<?php echo ($_SESSION['user']['username']); ?>
 -->
    <div id="search_bar" class="mt10">
       <div class="box">
          <div class="box_border">
            <div class="box_top"><b class="pl15">搜索</b></div>
            <div class="box_center pt10 pb10">
            <form id="form" class="" action="<?php echo U('Order/orderList');?>" method="post">
              <table class="form_table" border="0" cellpadding="0" cellspacing="0">
                <tr>
                  <td>课程名称</td>
                  <td><input type="text" name="course_name" value="<?php echo ($course_name); ?>" class="input-text lh25" size="20"></td>
                  <td>机构名称</td>
                  <td><input type="text" name="name" value="<?php echo ($name); ?>" class="input-text lh25" size="20"></td>
                  <td>订单状态</td>
                  <td>
				  <select class="select" id='order_status' name="order_status"> 
	            		<option value="" >---全部---</option>
	            		<?php if(($order_status == '已预约')): ?><option value="已预约" selected="selected" >已预约</option>
		            	<?php else: ?>
		            		<option value="已预约" >已预约</option><?php endif; ?>
	            		<?php if(($order_status == '已完成')): ?><option value="已完成" selected="selected" >已完成</option>
		            	<?php else: ?>
		            		<option value="已完成" >已完成</option><?php endif; ?>
	            		
	            	</select>
				  </td>
                  <td><input type="submit" class="btn btn82 btn_search" value="查询" ></td>
                </tr>
              </table>
            </form>
            </div>
          </div>
        </div>
    </div> 
<div id="table" class="mt10">
        <div class="box span10 oh">
              <table width="100%" border="0" cellpadding="0" cellspacing="0" class="list_table">
               <tr class="tr">
                  <th>序号</th>
                  <th>课程名称</th>
                  <th>机构名称</th>
                  <th>下单时间</th>
                  <th>预定用户</th>
                  <th>联系电话</th>
                  <th>订单状态</th>
                  <th width="150px">操作</th>
                </tr>
              <?php if(is_array($list)): foreach($list as $key=>$vo): ?><tr class="tr">
              		<td class="td_center"><?php echo ($key+1); ?></td>
              		<td class="td_center"><a href="<?php echo U('Order/orderLook');?>?id=<?php echo ($vo["id"]); ?>"><?php echo ($vo["course_name"]); ?></a></td>
              		<td class="td_center"><?php echo ($vo["center_name"]); ?></td>
              		<td class="td_center"><?php echo ($vo["create_time"]); ?></td>
              		<td class="td_center"><?php echo ($vo["username"]); ?></td>
              		<td class="td_center"><?php echo ($vo["phone"]); ?></td>
              		<td class="td_center"><?php echo ($vo["order_status"]); ?></td>
              		<td class="td_center">
              		<?php if(($vo["order_status"] == '已预约')): ?><a href="<?php echo U('Order/yifuk');?>?id=<?php echo ($vo["id"]); ?>&p=<?php echo ($p); ?>" onclick="del();">已完成</a><?php endif; ?>
              		</td>
              	</tr><?php endforeach; endif; ?>
              </table>
              <div class="page mt10" align='right'>
                <div class="pagination">
                  <?php echo ($page); ?>&nbsp;&nbsp;&nbsp;&nbsp;
                </div>

              </div>
        </div>
     </div>
   	 <script type="text/javascript">
        function del()
        {
            if (confirm("确定要修改订单吗？" ))
            {
                return true ;
            }
            else
            {
                return false ;
            }
        }
	    function yifuk(id){
	    	$.post("<?php echo U('/Order/yifuk');?>",{ id : id},function(data){
	    	})
	    }
	    //function tuikz(id){
	    //	$.post("<?php echo U('/Order/tuikz');?>",{ id : id},function(data){
	    //	})
	    //}
	 </script>
 </body>